5.13 Miscellaneous


5.13.1 Some useful functions


void complete_graph( graphGint n) & &creates a complete graph G with n nodes. void random_graph( graphGint nint m) &creates a random graph G with n nodes &and m edges. void test_graph( graphG) &creates interactively a user defined graph G. void test_bigraph( graphGnodelistAnodelistB) &creates interactively a user defined bipartite &graph G with sides A and B. All edges are &directed from A to B. bool compute_correspondence( graphGedge$\_array$(edge)& reversal) &computes for every edge e = (v, w) in G its &reversal reversal[e] = (w, v) in G ( nil if &not present). Returns true if every edge has a &reversal and false otherwise. void eliminate_parallel_edges( graphG) &removes all parallel edges from G. void cmdline_graph( graphG, int argc, char** argv) &builds graph G as specified by the command line &arguments: &prog & → test_graph() &prog n & → complete_graph(n) &prog n m & → test_graph(n, m) &prog file &G.read_graph(file)